/*
 * Main.java
 */
package strips;

import java.util.ArrayDeque;

/**
 *
 * @author mire
 */
public class Main {

    public static void main(String[] args) {
        String fileName = "/home/mire/Documents/fax/eks/projekat/primeri/";
        fileName += "6 rearange.txt";
        String[] states = StateParser.parseFile(fileName);
        ArrayDeque<Predicate> initialState = StateParser.parseStatesInLine(states[0]);
        ArrayDeque<Predicate> finalState = StateParser.parseStatesInLine(states[1]);

        Strips algorithm = new Strips(initialState, finalState);
        algorithm.setGlobalAtributes(StateParser.parseAtributesInLine(states[0]));

        System.out.println("Ciljno stanje");
        System.out.println(finalState);
        System.out.println("Pochetno stanje");
        System.out.println(initialState);

        ArrayDeque<Predicate> currentState = null;
        while ((currentState = algorithm.getNextState()) != null) {
            System.out.println("Akcija izvrshena:" + algorithm.getLastAction());
            System.out.println("Sledece stanje:");
            System.out.println(currentState);
        }
        System.out.println("Sve izvrshene akcije:");
        System.out.println(algorithm.getActions());

    }
}
